/*
 * ZipUtils.java
 * business
 *
 * Created by ChenTao on 2017/1/17.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.utils;

import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;

/**
 * Zip压缩工具
 *
 * <p>Created by ChenTao(chentao7v@gmail.com) on 2017/2/8 15:30
 */
public class ZipUtils {

    /**
     * 解压文件
     *
     * @param sourcePath 需要解压的zip文件路径
     * @param desDir     解压的目的地址
     */
    public static void unzip(String sourcePath, String desDir) throws ZipException {
        ZipFile zipFile = new ZipFile(sourcePath);
        zipFile.setRunInThread(true);
        zipFile.extractAll(desDir);
    }
}
